<!--create by 郭晓萌 on 2017.10.23-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="head :: head">
    <!--<link rel="import" href="../head.html"/>-->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
    <meta charset="utf-8"></meta>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
    <meta name="viewport" content="width=device-width, initial-scale=1"></meta>
    <title>智慧社区</title>

</head>

<body class="nav-md">

<div class="container body">

    <div class="main_container">
        <!-- 左树 -->
        <div class="col-md-3 left_col" id="letree1" th:replace="letree :: letree"></div>
        <!-- 头部 -->
        <div class="top_nav"  th:include="header :: top" ></div>
        <!-- 内容 -->
        <div class="right_col" role="main"></div>
    </div>
</div>
<footer th:replace="head :: footer">
    <script type="text/javascript" src="../../static/js/prompt.js" th:src="@{/js/prompt.js}"></script>
</footer>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/

    $(function () {//默认加载数据的table--(emp_list)
        $.goTo(/*[[@{toEmpList}]]*/"./emp_list.html");
    });

    function find() {//根据查询条件，查出数据，重新加载数据的table--(emp_list)

         if($("input[name='sts']").is(':checked')){//查询已删除或会员单位的信息
         $("input[name='sts']").val("1");
         }else{
         $("input[name='empType']").val("");
         }
         if($("input[name='orgType']").is(':checked')){
         $("input[name='orgType']").val("14");
         }else{
         $("input[name='orgType']").val("");
         }
         var findForm = $("#findForm").serialize();
         $.goTo("toEmpList",findForm);


    }

    function deleteEmp(obj) {//删除一条数据：逻辑删除为不可用状态
        /*[++]*/
        $.MsgBox.Confirm("提示", "请确认是否要删除", function () {
            var id = $(obj).attr("id");
            $.post("/emp/delete", {"empId": id}, function () {
                $.MsgBox.Alert("提示", "删除成功");
                find();
            });
        });

    }

    function see(obj) {//查看
        var empId = $(obj).attr("id");
        $.goTo("findOne/"+empId);
    }

    function updatePwd(obj){//重置密码
        /*[+
        var id = $(obj).attr("id");
        $.post("/emp/updatePwd", {"empId": id}, function () {
            $.MsgBox.Alert("提示", "重置成功");
            find();
        });
        +]*/
    }

    function updateEmp(obj) {//修改
        var empId = $(obj).attr("id");
        $.goTo("updateEmp/"+empId);
    }

    function reset(obj){//重置
        var empId = $(obj).attr("id");
        $.goTo("updateEmp/"+empId);
    }

    function reply(obj){//恢复账号状态
        /*[+
        $.MsgBox.Confirm("提示", "请确认是否要恢复", function () {
            var id = $(obj).attr("id");
            $.post("/emp/reply", {"empId": id}, function () {
                $.MsgBox.Alert("提示", "恢复成功");
                find();
            });
        });
        +]*/
    }

    function before(obj){//初始化密码
        /*[+
         var id = $(obj).attr("id");
         $.post("/emp/before", {"empId": id}, function () {
         $.MsgBox.Alert("提示", "初始化密码成功");
         find();
         });
         +]*/
    }
    //重置修改表单为空
    function resetting(){
        $(':input', '#saveAndFlushForm')
            .not(':button,:submit,:reset')   //将myform表单中input元素type为button、submit、reset、hidden排除
            .val('')  //将input元素的value设为空值
            .removeAttr('checked')
            .removeAttr('checked') // 如果任何radio/checkbox/select inputs有checked or selected 属性，将其移除
    }
    //返回
    function backup(){
        $.goTo(/*[[@{toEmpList}]]*/"./emp_manage/emp_list.html");
    }

    function up(number) {//分页跳转，上一页
        /*[+
         var findForm = $("#findForm").serialize();
         var number = parseInt(number);
         $.goTo("toEmpList?page="+number,findForm);
         +]*/
    }

    function next(number) {//分页跳转，下一页
        /*[+
         var findForm = $("#findForm").serialize();
         var number = parseInt(number) + 2;
         $.goTo("toEmpList?page="+number,findForm);
         +]*/
    }
    function pageTo(page) {
        /*[+
         var number = page;
         var findForm = $("#findForm").serialize();
         $.goTo("toEmpList?page=" + number,findForm);
         +]*/
    }
    /*]]>*/
</script>
</body>
</html>
